package org.dq.base.page;

public class PageParam {
	
	private Page pageObj;//分页对象
	
	private String page; //提交的页码?
	private String rows;//每页记录行?
	
	//记录数的偏移量，例如每页10条记录，则第三页的偏移量??20（条件）?
	private String offset;
	
	/**
	 * 页码
	 * @return
	 */
	public String getPage() {
		if(offset==null)return page;
		
		try {
			int _offset=Integer.parseInt(getOffset());
			int _limit=Integer.parseInt(getLimit());			
			return String.valueOf(_offset/_limit+1);
		} catch (Exception e) {
			throw new PageException(e);
		}
		
	}
	public void setPage(String page) {
		this.page = page;
	}
	
	public String getLimit() {
		return rows;
	}
	public void setLimit(String rows) {
		this.rows = rows;
	}
	
	
	public String getOffset() {
		return offset;
	}
	public void setOffset(String offset) {
		this.offset = offset;
	}
	/**
	 * 每页（最大）记录�?
	 * @return
	 */
	public String getRows() {
		return rows;
	}
	public void setRows(String rows) {
		
		this.rows = rows;
		
		
	}
	
	
	
	public Page getPageObj() {
		return pageObj;
	}
	
	

}
